<?php
/*
 * Created on 23.04.2008
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
 class Controller_News extends Controller_Base {
 	
 	function index($args) {
 		$template = new Template('news.tmpl');

 		$template->setArgs(
 			array( 
				_user		=> $this->user,
				menu		=> $this->menu->getMenu(1),
				alias		=> 'news',
			)
		);
		
		return array(
 			status 		=> 0,
 			template	=> $template
 		); 
 	}
 	
 	function view($args) {
 		$template = new Template('news_full.tmpl');

		$news = new Model_News();

 		$template->setArgs(
 			array( 
				_user		=> $this->user,
				menu		=> $this->menu->getMenu(1),
				alias		=> 'news',
				news		=> $news->find(array(id => $args[0])),
				back		=> $_SERVER['HTTP_REFERER'],
			)
		);
		
		return array(
 			status 		=> 0,
 			template	=> $template
 		); 		
 	}
 	
 }
 
?>
